THE STANDARD BALCHECK TESTS


This documentation goes into detail covering all the various tests that are
performed on a Bally/Astrocade motherboard when running the standard tests in the
upgraded commercial version of Balcheck contained within the 8KB programming
package called "BalcheckHR" by MCM Design.

See the BalcheckHR user manual doc "Set Up" for MCM Design's recommendation in
setting up the BalcheckHR board to run the standard Balcheck tests.

Once the motherboard and BalcheckHR board are set up and powered on, to
execute the standard Balcheck tests, simply press the system reset button, if
necessary. The sytem may "reset" automatically at power on.

When the system is "reset", the Z80 CPU is forced to begin executing on-board ROM
instructions at 0000H. Eight instructions in the on-board ROM will be executed
including the jump to 2000H instruction, where the Balcheck program resides.

Balcheck will attempt to initialize the dual 7-segment display on the BalcheckHR
board to - - (dash dash), which indicates the Z80 CPU and on-board ROM are
operating enough to jump to the Balcheck program.

Various parameters will also be initialized. This upgraded version of the
commercial Balcheck does NOT check if any key in the 24 button keypad is stuck
in the "down" position.

Balcheck first tests the screen RAM stack thru scratch pad area 4F00-4FFFH. If
this area is not operating properly, Balcheck will immediately output an error
report sequence on the dual display.

If this 4F00-4FFFH area IS working, then Balcheck will attempt to set up and
check for a normal operating screen interrupt generation. The normal screen
interupt routine is used to scan the keypad for any user request to execute an
optional routine or demo. The interrupt routine also runs an internal Balcheck 
"run time" clock.

If no optional program execution is requested by the user, by pressing a keypad
key, then Balcheck will execute its additional tests and instruct the dual
display to begin counting up in seconds.

The additional tests that Balcheck will perform are:

Test on-board ROM checksum
Test RAM 4F00-4FFFH again
Test RAM 4000-4EFFH
Shifter test
Flopper test
Expander test
OR/XOR write test, OR/XOR intercept test
Trigger/joystick/pot test
Exercise output ports

During the first pass of these additional tests, no error will be reported on
the dual display.

Balcheck will then attempt a second pass of the above 9 tests in the order
listed, this time reporting any error detected. If an error is found, then an
error report sequence will be output to the dual display as follows:


error code

][ (custom character indicating the info/data error byte follows next)

info/data error

HE

LP

1.9 sec blank display


This sequence will repeat nonstop until the system reset button is pressed.

If the user does not press a key on the keypad to request execution of an
optional program, Balcheck will attempt to run a total of 4 passes of the 9
additional tests, unless an error is detected. At the end of the 4th pass, the
screen will be blacked out, except for a blue 2 byte rectangle near the middle
of the screen.

It takes about 19 seconds to run 4 passes of tests. If no error is detected by
Balcheck during the 4 passes, the dual display will stop counting up and output
E1 to indicate all the tests have "passed".

If the Q/S key is pressed during the 4 passes of Balcheck tests, the testing
will continue nonstop, unless an error is detected.

During the Balcheck nonstop testing mode, the dual display will keep track of
elapsed run time alternating in hours Xh, where X will count up from 0 to 9
hours, and in minutes. Maximum elapsed run time is 9:59:59, alternately
displayed as 9h and 59. Seconds are not displayed.

If you don't press the Q/S key before the end of the 4th pass, but press it
after the 4th pass, you will turn on the display's hr/min clock, but no tests
will be executed.

Balcheck will respond in 1 of 3 ways when you attempt to execute it.

1. The dual display will not initialize to - - (dash dash) and count up in
   seconds.

   There is a failure preventing Balcheck from executing.
   The Z80 CPU and the on-board ROM must be working enough to execute Balcheck.
   The failure is likely a Zone A or Zone B failure, where:

   A. Zone A is defined as:

      The motherboard power supply.
      The black Bally AC power supply.
      All DC power supply lines and gnd lines to all the motherboard chips
      including all the chip decoupling capacitors.

      For Zone A troubleshooting tips, see the doc "Troubleshooting The Power
      Supply In The Bally/Astrocade Home Computer System" which is archived in
      the BallyAlley.com website in the FAQs section.

   B. Zone B is defined as:

      All circuitry and chips/chip pins wired to the Z80 CPU address A0-A15 and
      data D0-D7 buses including:

      The Z80 system clock input (1.7778 Mhz) at pin 6.
      The on-board ROM and cassette cartridge ROM decoders.
      
      If Zone A is operating and the system clock is present at pin 6 of the
      Z80 CPU, then try running the "Remote ROM" and "Z80 Check" programs,
      which are included in the BalcheckHR EEPROM. These 2 programs may help
      isolate the failure in Zone B. See the doc on these 2 programs in the
      BalcheckHR user manual. This doc is labeled as "Optional Troubleshooting
      Programs".


2. An error report sequence is output to the dual display.

   For details on Balcheck's error reports, see the doc "Error Reports" in the
   BalcheckHR user manual.


3. Balcheck executes 4 passes of tests and outputs E1 on the dual display.

   When the dual display outputs E1, the Balcheck tests have "passed" detecting
   no error.

   Note:
   You can optionally run the Balcheck tests nonstop by pressing the Q/S key
   before the end of the 4th pass of Balcheck tests. In this nonstop mode,
   Balcheck will keep track of the "run time" and alternately output hours and
   minutes on the dual display.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

TEST RAM/VIDEO DATA LINES


The first test that Balcheck performs is to check the RAM locations 4F00-4FFFH.
A portion of this area is utilized by the Z80 CPU as the stack area. This stack
area must be working perfectly to execute the next Balcheck test, which checks
the generation of screen interrupts.

If Balcheck detects an error in any of the RAM bytes 4F00-4FFFH, the error will
be reported on the dual display using a sequence. See the BalcheckHR user
manual doc "Error Reports" for details.

If Balcheck can get past the screen interrupts test and the ROM checksum test,
it will then check again RAM locations 4F00-4FFFH and also check RAM locations
4000-4EFFH.

There is a Test RAM Flow Chart in the BalcheckHR user manual file
"Miscellaneous Scans".

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

TEST SCREEN INTERRUPT MODE 2 (IM2)

If the Z80 CPU will not execute the Balcheck screen interrupt routine or is
not receiving the screen interrupt mode 2 request from the custom address
chip, an error will be reported on the dual display.

When Balcheck's first test to check RAM locations 4F00-4FFFH "passes", Balcheck
will then attempt to set up a screen interrupt to execute a subroutine which
is used to scan all 4 columns on the keypad. This interrupt subroutine will
respond to a request to execute an optional demo or program when the user
presses a specific key. The subroutine will also update an internal "run time"
clock used during execution of Balcheck's additional tests.

Balcheck will test to see if the Z80 CPU received a request to interrupt the
standard Balcheck tests and actually executed the screen interrupt subroutine
by checking the internal 1/60 sec and seconds clock times. If no incrementation
in time is detected by Balcheck, then the Z80 CPU did not execute the screen
interrupt subroutine or did not receive an interrupt request by the custom
data chip, in which case, Balcheck will report this error on the dual display.
See the BalcheckHR user manual doc "Error Reports" for details on the error
report.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

TEST ROM CHECKSUM

Balcheck assumes the motherboard being tested is utilizing one 8KB ROM chip.
Balcheck will compute the checksum and pass a checksum of FC or A4.

The earlier version 8KB ROM chip has a checksum of FC. The bottom of the menu
listing will display (C) BALLY MFG 1977.

The later version 8KB ROM chip has a checksum of A4. The bottom of the menu
listing will display (C) BALLY MFG 1978.

The checksums of an older motherboard utilizing four 2KB ROM chips can also
be tested. However, the user must inform Balcheck that the motherboard being
tested has four 2KB ROM chips, by holding down the key 8 while pressing the
system reset button. Balcheck will then check each 2KB ROM chip, one at a
time, to see if the checksum computed is FF. If a checksum total is not FF,
testing will terminate and an error will be reported on the dual display.
See the BalcheckHR user manual doc "Error Reports" for details.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

TEST THE MAGIC SHIFTER FUNCTION

If a magic shift error is detected, the error will be reported on the dual
display. See the Balcheck user manual doc "Error Reports" for details.

Reference also the Nutting Manual, p.96-97 and p.94 for info on the magic
shifter function. This manual is archived on the BallyAlley.com website in the
Machine Language/Astrocade ML Docs section.


THE BALCHECK TEST SHIFTER ROUTINE

This routine outputs the shift amount 00H to the magic register, writes an one
byte pattern to the magic address 0810H and compares the resultant pattern
with the expected pattern. If an error is found, it is reported on the dual
display. 

This procedure is repeated 7 more times with a diferent pattern written each
time to the magic address 0810H. The 8 one byte patterns written are:
01, 02, 04, 08, 10, 20, 40 and 80H.

The above is repeated 3 more times each, except the shift amount 01H is output,
then 02H is output and finally 03H is ouput to the magic register.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

TEST THE MAGIC FLOPPER FUNCTION

If a magic flop error is detected, the error will be reported on the dual
display. See the BalcheckHR user manual doc "Error Reports" for details.

Reference also the Nutting Manual p.96-97 and p.94 for info on the magic
flopper function. This manual is archived on the BallyAlley.com website in the
Machine Language/Astrocade ML Docs section.


THE BALCHECK TEST FLOPPER ROUTINE

This routine outputs 40H to the magic register, writes an one byte pattern to
the magic address 0810H and compares the resultant pattern with the expected
pattern. If an error is found, it is reported on the dual display.

This procedure is repeated 15 more times with a diferent pattern written each
time to the magic address 0810H. The 16 one byte patterns written are:
01, 02, 04, 08, 10, 20, 40, 80, 7F, BF, DF, EF, F7, FB, FD, and FEH.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

TEST THE MAGIC EXPANDER FUNCTION

If a magic expand error is detected, the error will be reported on the dual
display. See the BalcheckHR user manual doc "Error Reports" for details.

Reference also the Nutting Manual p.95 and p.94 for info on the magic expander
function. This manual is archived on the BallyAlley.com website in the
Machine Language/Astrocade ML Docs section.


THE BALCHECK TEST EXPANDER ROUTINE

This routine outputs 08H to the magic register, outputs 00H to the expand
register (output port 19H) and writes an one byte pattern to the magic
addresses 0810H and 0811H. The resultant pattern is compared with the expected
pattern. If an error is found, it is reported on the dual display. 

This procedure is repeated 3 more times with a diferent pattern written each
time to the magic addresses 0810H and 0811H.

The above is repeated 3 more times each, except 05H is output, then 0AH
is output and finally 0FH is output to the expand register.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

TEST THE MAGIC OR WRITE FUNCTION
TEST THE OR INTERCEPT FUNCTION

TEST THE MAGIC XOR WRITE FUNCTION
TEST THE XOR INTERCEPT FUNCTION

If an error is detected in any of the above 4 functions, the error will be
reported on the dual display. See the BalcheckHR user manual doc "Error
Reports" for details.

Reference also the Nutting Manual p.100 and p.94 for info on these 4 
functions. This manual is archived on the BallyAlley.com website in the
Machine Language/Astrocade ML Docs section.

The logic table for the OR function is as follows.

X  Y  X OR Y
------------
0  0    0
0  1    1
1  0    1
1  1    1

The logic table for the XOR function is as follows.

X  Y  X XOR Y
-------------
0  0     0
0  1     1
1  0     1
1  1     0

where: X = bit that is being written
       Y = bit that is presently in screen RAM
       X OR Y, X XOR Y is resultant bit in screen RAM


THE BALCHECK TEST OR/XOR WRITE, OR/XOR INTERCEPT ROUTINE

   The routine outputs 10H to the magic register.

1. An one byte pattern D is written to the screen RAM address 4810H and
   an one byte pattern C is written to the magic address 0810H.

   The resultant pattern is compared to the expected pattern. If an error is
   found, it is reported on the dual display.

   If no error is found, then the intercept status is compared to the expected
   intercept status. If an error is found in the intercept comparison, it is
   reported on the dual display.

   This procedure is repeated 3 more times with a different pattern written
   each time to the magic address 0810H. The 4 one byte patterns C used are
   00, 01, 02 and 03H. The pattern D used is 00H.

2. The above procedure 1 is repeated except the 4 one byte patterns C used are
   00, 04, 08 and 0CH.

3. The above procedure 1 is repeated except the 4 one byte patterns C used are
   00, 10, 20 and 30H.

4. The above procedure 1 is repeated except the 4 one byte patterns C used are
   00, 40, 80 and C0H.

5. The above procedures 1 thru 4 are repeated except the pattern D used is 55H.

6. The above procedures 1 thru 4 are repeated except the pattern D used is AAH.

7. The above procedures 1 thru 4 are repeated except the pattern D used is FFH.

8. The routine outputs 20H to the magic register and performs 1 thru 7 above.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

TEST HAND CONTROL INPUT PORTS

If the joystick/trigger status of any of the 4 input ports is nonzero, an error
is reported on the dual display.

If the potentiometer status of any of the 4 inputs is not FF, an error is
reported on the dual display. Note some aged motherboards may sense only an input
maximum of FE which will not pass the Balcheck Pot Test.

If you have a motherboard that fails the above 2 status tests, use Balcheck's
optional "Monitor The Input Ports" program to check(monitor) the present status.

See the BalcheckHR user manual doc "Error Reports" for details.

Reference also the Nutting Manual p.102 for hand control input port details.
This manual is archived on the BallyAlley.com website in the Machine
Language/Astrocade ML Docs section.


THE BALCHECK TEST HAND CONTROL INPUT PORTS ROUTINE

This routine assumes all 4 hand controls are NOT connected to the motherboard.

The routine checks the joystick/trigger status of input port 10H. If the status
is nonzero, the error is reported on the dual display. The status of the other
3 ports 11, 12 and 13H are also tested reporting a nonzero status as an error.
Testing terminates if an error is found.

The routine then checks the potentiometer status of the input port 1CH. If the
status is not FF, the error is reported on the dual display. The status of the
other 3 input ports 1D, 1E and 1FH are also tested reporting a status less 
than FF as an error. Testing terminates if an error is found.

Errors can be simulated by inserting a hand control in any of the 4 hand
control sockets and by:

1. Turning the pot knob away from the fully counter clockwise position.
2. By pressing the trigger.
3. By moving the joystick up, down, left or right.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

EXERCISE THE OUTPUT PORTS

The Z80 register B is initialized to 255(FFH).

This routine then sets:
The consumer mode (output port 08) to low resolution,
All 8 color register output ports 0 thru 7 to color B (Z80 register),
Output port 09 to 20(14H),
The vertical blank register (output port 0AH) to 198(C6H),
The color registers using output port 0BH to the values shown in the table below,
And exercises the sound ports 10-18H to produce sound.

The above is repeated 254(FEH) more times decrementing color B by 1 each time.


    Hexadecimal
Color Values Output     Corresponding
    To Port 0BH         Color Register

        DB                    7
        92                    6
        49                    5
        00                    4
        DB                    3
        92                    2
        49                    1
        00                    0




End of document
MCM DESIGN
DEC 2018
